package miracle.joker.design.composite;

public class ComponentDemo {

    public static void main(String[] args) {
        Composite development = new Composite();
        development.add(new Employee("John", 10000));
        development.add(new Employee("David", 20000));
        development.add(new Employee("Mike", 30000));

        Composite sales = new Composite();
        sales.add(new Employee("Larry", 15000));
        sales.add(new Employee("Bill", 25000));
        sales.add(new Employee("Steve", 35000));

        Composite organization = new Composite();
        organization.add(development);
        organization.add(sales);

        System.out.println("Total salary: " + organization.getSalary());
    }
}
